@extends('Admin.Layouts.index')

@section('active2')
	active
@endsection

@section('title_name')
	用户修改
@endsection

@section('container')
	<div class="container">
		<div class="mws-panel grid_8">
            <div class="mws-panel-header">
                <span>用户修改</span>
            </div>
            @if(count($errors)>0)
                <div class="mws-form-message error">
                    <ul>
                        @foreach($errors->all() as $error)
                            <li>{{$error}}</li>
                        @endforeach
                    </ul>
                </div>
            @endif
            <div class="mws-panel-body no-padding">
                <form class="mws-form" action="/admin/users/{{$data['id']}}" method="post">
                    {{method_field('put')}}
                    {{csrf_field()}}
                    <div class="mws-form-inline">
                        <div class="mws-form-row">
                            <label class="mws-form-label">用户名称</label>
                            <div class="mws-form-item">
                                <input name="username" value="{{$data['username']}}" class="small required" type="text">
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label class="mws-form-label">用户密码</label>
                            <div class="mws-form-item">
                                <input name="password" value="{{$data['password']}}" class="small" type="password">
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label class="mws-form-label">确认密码</label>
                            <div class="mws-form-item">
                                <input name="surepass" value="{{$data['password']}}" class="small" type="password">
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label class="mws-form-label">用户状态</label>
                            <div class="mws-form-item">
                                <select name="status" value="" class="small">
                                    <option value="">请选择</option>
                                    <option value="1" {{$data['status']==1? 'selected':''}}>开启</option>
                                    <option value="0" {{$data['status']==0? 'selected':''}}>关闭</option>
                                </select>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label class="mws-form-label">用户权限</label>
                            <div class="mws-form-item clearfix">
                                <ul class="mws-form-list inline">
                                    <li><label><input name="auth" value="1" type="radio" {{$data['status']==1? 'checked':''}}> 超级管理员</label></li>
                                    <li><label><input name="auth" value="2" type="radio" {{$data['status']==2? 'checked':''}}> 普通管理员</label></li>
                                    <li><label><input name="auth" value="3" type="radio" {{$data['status']==3? 'checked':''}}> 普通用户</label></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <div class="mws-button-row">
                        <input value="修改" class="btn btn-danger" type="submit">
                    </div>
                </form>
            </div>
        </div>
	</div>
@endsection